home *** CD-ROM | disk | FTP | other *** search
- ---------------------------------------------------------------------------
-
- UpTime
- $VER: UpTime.doc 1.7 (11.01.94)
-
- ---------------------------------------------------------------------------
-
- The files in this archive were written by Jürgen Matern and are freely
- distributable as long as the archive remains intact, and only a nominal fee
- is charged for its distribution.
-
- Files in archive 'UpTime17.lha':
-
- UpTime.info
- UpTime/Install_UpTime Version: 1.6 (19.10.93)
- UpTime/Install_UpTime.info
- UpTime/UpTime.doc Version: 1.7 (11.01.94)
- UpTime/UpTime.doc.info
- UpTime/install/AddSlash Version: 1.0 (23.09.93)
- UpTime/install/CheckDir Version: 1.0 (23.09.93)
- UpTime/install/ExtractYear Version: 1.0 (20.09.93)
- UpTime/install/UpTime.txt
- UpTime/s/CronTab
- UpTime/s/CronTab.part1
- UpTime/s/CronTab.part2
- UpTime/s/CronTab.part3
- UpTime/scripts/AtMidNite Version: 1.0 (23.09.93)
- UpTime/scripts/CheckBootDate Version: 1.1 (09.01.94)
- UpTime/scripts/CutArg Version: 1.0 (20.09.93)
- UpTime/scripts/IncreaseUpTime Version: 1.0 (23.09.93)
- UpTime/scripts/NewFileNames Version: 1.1 (09.01.94)
- UpTime/scripts/OnOff Version: 1.1 (09.01.94)
- UpTime/scripts/SayUpTime Version: 1.0 (23.09.93)
- 20 files
-
- This software is provided "AS IS" without warranty of any kind, either
- expressed or implied. By using it, you agree to accept the entire risk as
- to the quality and performance of the programs.
-
- This software is GIFTWARE! If you like it, I would appreciate your sending
- me a postcard from where you live!
-
- Comments, suggestions and bug reports are welcome.
-
- Jürgen Matern
- Herrlingen
- Max-Wieland-Straße 13
- 89134 Blaustein
- GERMANY
-
- Internet: s_matern@rzmain.rz.uni-ulm.de
-
- Overview
- --------
- If you ever wanted to know, how long your computer is workig every day and
- you didn't know how to get this information, then this package is the
- solution of your problem. Once this package is installed you get three
- files, which are updated every day. In the first file you will find the
- time, your computer worked (listed day by day), in the second file you will
- find a note, every time your computer booted and in the third you can see,
- when you turned your system on, when you turned it off, and how many resets
- you had.
-
- Here three little sample-logfiles:
-
- The UpTime-file:
- ...
- Montag 20-Sep-93 SystemUpTime: 4 h 40 min.
- Dienstag 21-Sep-93 SystemUpTime: 10 h 45 min.
- Mittwoch 22-Sep-93 SystemUpTime: 4 h 45 min.
-
- The Log-file:
- ...
- Dienstag 21-Sep-93 22:28:34
- Dienstag 21-Sep-93 22:29:18
- Dienstag 21-Sep-93 22:38:07
- Mittwoch 22-Sep-93 08:39:11
- Mittwoch 22-Sep-93 17:12:27
- Mittwoch 22-Sep-93 18:01:08
-
- The OnOff-file:
- ...
- Turned system on: Dienstag 21-Sep-93 22:28:34
- You had 2 resets!
- Turned system off: Dienstag 21-Sep-93 22:45:01
-
- Turned system on: Mittwoch 22-Sep-93 08:39:11
- Turned system off: Mittwoch 22-Sep-93 10:35:00
-
- Turned system on: Mittwoch 22-Sep-93 17:12:27
- You had 1 reset!
- Turned system off: Mittwoch 22-Sep-93 19:55:00
-
-
- The scripts can also control events, you only want to run once a day (i.e.
- updating of a find-database or something like this). In the two scripts,
- which control these events (CheckBootDate and AtMidNite) there is the
- standard-event of my system, which is executed once every day. It's the
- program 'updatedb'. Remove this line, if you don't use it, and put any
- other 'once-day-events' at its place. See the file 'Find.lha' in the
- Goodies-directory for more information on 'updatedb'.
-
- This package consists of some AmigaDOS-scripts. These scripts have to be
- controlled via cron (an utility, which starts a script or program at
- defined times). If you don't use a cron-utility yet, you will have to
- install a cron-utility yourself. Perhaps you try 'CyberCron' from
- Christopher A. Wichura. You can find it on Fish 801. For the latest
- version also check newer ><> and in AmiNet (path: ../aminet/os20/cli/).
-
- The scripts also need some ENV-variables to be declared (will be defined by
- the installscript).
-
- As the programs are all AmigaDOS-scripts it should be easy, to modify the
- scripts to fit your suits.
-
- Requirements
- ------------
- * OS 2.04 or later (never tested with 1.3)
- * The install-script needs the 'Pipe:'-device to be mounted
- * HardDisk is not required but strongly recommended
- * A cron-utility (i.e. CyberCron from Fish 682)
-
- Installation
- ------------
- The installation-procedure is done by an AmigaDOS-script, which should run
- correctly on every 'standard installed' system. You can open a
- shell-window, and start it via 'execute', or by double-clicking on its
- icon. The UpTime-installscript (Install_UpTime) will execute some other
- scripts which are located in the install-directory.
-
- The different scripts
- ---------------------
- AddSlash: This script is executed by the UpTime-installscript. You can
- start it like every other AmigaDOS-script. As argument it requires a
- path. If there is no '/' or ':' at the end of the path it appends a '/'
- and prints the new path to the actual shell-window. This one isn't
- copied to your system.
-
- AtMidNite: This script has to be executed by cron every midnight (only,
- when computer is working at this time). It resets the UpTime to 0, and
- writes the UpTime of the last day to the UpTime-file. It also checks,
- whether the year changed (i.e. 1993 to 1994) and changes the filenames
- of the two logfiles when necessarry (via NewFileNames). This script
- needs some ENV-variables to be declared. These variables are:
- - UpTime/LastBoot has been installed by CheckBootDate
- - UpTime/UpTime has been installed by IncreaseUpTime
- - UpTime/UpFileName has been installed by UpTime-installscript
- In line #47 of the script you can see my 'once-day-event', if you would
- like to run some programs only once a day then add the line desired to
- this script. Remove this line, if you don't use 'FIND'.
-
- CheckBootDate: This script is called via by the user-startup in your
- s:-directory. It resets the UpTime to 0, and writes the UpTime of the
- last day to the UpTime-file. It also checks the newyear-flag which was
- set by the OnOff-script and changes the filenames of the three logfiles
- when necessarry (via NewFileNames). It also writes the date of the
- actual 'booting' to the BootLogFile. This script needs some ENV-
- variables to be declared. These variables are:
- - UpTime/UpTime has been installed by IncreaseUpTime
- - UpTime/UpFileName has been installed by UpTime-installscript
- - UpTime/LogFileName has been installed by UpTime-installscript
- In the line #52 of the script there you can see my 'once-day-event', if
- you would run some program only once a day then add the desired line to
- this script (before the endif-command in line #53). Remove line #52, if
- you don't use 'FIND'.
-
- CheckDir: This script is executed by the UpTime-installscript. You can
- start it like every other AmigaDOS-script. As argument it requires the
- name of the directory it should create. If you specify an optional
- argument the user is asked, whether the directory should be created,
- otherwise the directory is created without asking the user. The script
- also checks for an already existing directory or an existing file of the
- same name. This one isn't copied to your system.
-
- CutArg: This script is called by the following scripts: AtMidNite,
- CheckBootDate and SayUpTime. It needs three arguments and returns the
- first two of them.
-
- ExtractYear: This script is executed by the UpTime-installscript. You can
- start it like every other AmigaDOS-script. As argument it requires a
- date in the format of the AmigaDOS date-command. From this date the
- actual year is extracted and printed to the actual shell-window. This
- two characters are appended as a suffix to the BaseNames, which are
- installed by the UpTime-installscript. So you will get two new files
- every new year. This one isn't copied to your system.
-
- IncreaseUpTime: This script has to be executed by cron every ten minutes
- and thus the 'heart' of the whole package. It just adds 10 to the
- variable UpTime/UpTime and writes out a date, which is the last moment,
- the system is expected to run. If you want a more accurate UpTime of
- your system, then you should call this script every 5 minutes via cron
- and then change the 10 to 5 in this script.
-
- NewFileNames: This script is called by the UpTime-installscript and builds
- the new filenames. It is also called, when one of the two scripts
- (CheckBootDat or AtMidNite) recognizes, that we have a new year. It
- requires some ENV-variables declared:
- - UpTime/UpBaseName has been installed by the UpTime-installscript
- - UpTime/LogBaseName has been installed by the UpTime-installscript
- - UpTime/OnOffBaseName has been installed by the UpTime-installscript
- It writes the new filenames to ENV:UpTime and ENVARC:UpTime.
-
- OnOff: This one is called by 'CheckBootDate'. It checks, if the date, which
- was written by 'IncreaseUpTime' is older than 12 minutes. If this is
- true, you switched your system on, otherwise, you only reseted your
- computer. If you changed the standard UpTime-intervall of 10 minutes to
- another value, then you should modify this scripts. See in the script
- for more information on this topic. This script also checks, whether the
- year changed (i.e. 1993 to 1994) and sets the newyear-flag when
- necessarry.
-
- SayUpTime: This script has to be manually executed by the user via the cli.
- It then prints out the actual UpTime of the system.
-
- Limitations
- -----------
- As I don't want to keep the system busy with working on UpTime-scripts I
- only increase the UpTime every ten minutes. So the UpTime may slightly
- differ from the real uptime of your system.
-
- If you install the package, the first entry of the UpTime-logfile won't be
- very useful, because we have no valid date yet.
-
- Acknowledgments
- ---------------
- I would like to give my thanks to the following persons (in alphabetical
- order):
-
- Gerri Körner For some beta-testing.
-
- Christopher A. Wichura For writing CyberCron.
-
- Armin Wies For some ideas.
-
- and all the other Amigos.
-
- Last changed: 11. January 1994 by Jürgen Matern
-